Rachel
Toggle table of contents
3.5.0
desktop
Target filter
desktop
Switch theme
Search in API
Skip to content
Rachel
love.yinlin.compose.platform-view
/
love.yinlin.compose.ui
/
[desktop]PlatformView
Platform
View
desktop
@
Stable
abstract
class
PlatformView
<
V
:
Component
>
:
BasicPlatformView
<
V
>
Members
Constructors
Platform
View
Link copied to clipboard
desktop
constructor
(
)
Properties
host
Link copied to clipboard
desktop
val
host
:
V
?
Functions
host
Link copied to clipboard
desktop
fun
host
(
block
:
(
V
)
->
Unit
)
:
Unit
?
Host
View
Link copied to clipboard
desktop
@
Composable
open
override
fun
HostView
(
modifier
:
Modifier
=
Modifier
)
Monitor
Link copied to clipboard
desktop
@
Composable
fun
Monitor
(
key1
:
Any
?
,
block
:
suspend
CoroutineScope
.
(
V
)
->
Unit
)
等同于 LaunchedEffect, 但会监听自身创建。 因为重组是无序的,使用 Monitor 可以避免 HostView 未被创建时就触发了 key 变化而后续不触发的问题。
@
Composable
fun
Monitor
(
vararg
keys
:
Any
?
,
block
:
suspend
CoroutineScope
.
(
V
)
->
Unit
)
@
Composable
fun
Monitor
(
key1
:
Any
?
,
key2
:
Any
?
,
block
:
suspend
CoroutineScope
.
(
V
)
->
Unit
)